package com.zhengjiang.sms.common;

import lombok.Builder;
import lombok.Data;

/**
 * @ClassName ResponseDto
 * @Description
 * @Author zhengjiang(99514925 @ qq.com)
 * @Date 2020-06-02 17:09
 * @Version V1.0
 **/
@Data
@Builder
public class ResponseDto {
    private Integer code;
    private String message;
    private Object data;

    public static ResponseDto success(){
        return ResponseDto.builder().code(200).message("success").build();
    }

    public static ResponseDto success(String message){
        return ResponseDto.builder().code(200).message(message).build();
    }

    public static ResponseDto fail(){
        return ResponseDto.builder().code(500).message("fail").build();
    }

    public static ResponseDto fail(String message){
        return ResponseDto.builder().code(500).message(message).build();
    }

}
